<template>
    <div>
        <h1>测试Pinia</h1>
        <p>
            计数器：{{ count }}
        </p>
        <button @click="handleIncrement">++</button>
    </div>
</template>
<script setup>
import { storeToRefs } from 'pinia';
import { useCounterStore } from '../stores/counter';
const counterStore = useCounterStore();
const {count} = storeToRefs(counterStore);
const {increment} = counterStore;
function handleIncrement(){
    console.log(count.value)
    increment(10);
}
</script>